import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

public class RedPacketDistribution {
    public static List<Double> distributeRedPacket(double totalAmount, int numPeople) {
        if (totalAmount <= 0 || numPeople <= 0) {
            throw new IllegalArgumentException("总金额和人数必须大于0");
        }

        // 确保每人至少能分到0.01元
        if (totalAmount < numPeople * 0.01) {
            throw new IllegalArgumentException("总金额不足以每人分到0.01元");
        }

        List<Double> result = new ArrayList<>();
        Random random = new Random();

        // 转换为分计算，避免浮点精度问题
        int remainingAmount = (int) (totalAmount * 100);
        int remainingPeople = numPeople;

        for (int i = 0; i < numPeople - 1; i++) {
            // 随机范围：[1, remainingAmount - remainingPeople + 1]
            int max = remainingAmount - remainingPeople + 1;
            int amount = random.nextInt(max) + 1;
            result.add(amount / 100.0);
            remainingAmount -= amount;
            remainingPeople--;
        }

        // 最后一个人分得剩余金额
        result.add(remainingAmount / 100.0);

        return result;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double totalAmount = sc.nextDouble(); // 红包总金额
        int numPeople = sc.nextInt();        // 红包个数

        List<Double> distribution = distributeRedPacket(totalAmount, numPeople);

        System.out.println("红包分配结果：");
        double sum = 0;
        for (int i = 0; i < distribution.size(); i++) {
            System.out.printf("第%d个人: %.2f元%n", i + 1, distribution.get(i));
            sum += distribution.get(i);
        }

        System.out.printf("总金额: %.2f元%n", sum);
    }
}